<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial - scale=1.0">
    <link rel="stylesheet" href="../static/css/behind manager.css" th:href="@{/css/behind manager.css}">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <title>评论管理</title>
</head>
<body>
<div class="box">
    <div class="nav-container">
        <div class="logo">
            <img src="../static/img/logo.png" alt="Ant Design Pro" th:src="@{/img/logo.png}">
            <p class="name">Haven Manager</p>
        </div>
        <div class="user-info">
            <span class="username">后台管理</span>
        </div>
        <ul class="nav">
            <li><a href="http://localhost:8080/admin/behindManagerUser" th:href="@{/admin/behindManagerUser}"  data-target="adminManagement" class="nav-link ">用户管理</a></li>
            <li><a href="http://localhost:8080/admin/behindManagerPost" th:href="@{/admin/behindManagerPost}" data-target="systemManagement" class="nav-link">帖子管理</a></li>
            <li><a href="http://localhost:8080/admin/behindManagerCategory" th:href="@{/admin/behindManagerCategory}" data-target="kindManagement" class="nav-link">类别管理</a></li>
            <li><a href="http://localhost:8080/adminbehindManagerComment" th:href="@{/admin/behindManagerComment}" data-target="pinglunCenter" class="nav-link active">评论管理</a></li>
            <li><a href="http://localhost:8080/admin/behindManagerReport" th:href="@{/admin/behindManagerReport}" data-target="jubaoManager" class="nav-link">举报管理</a></li>
        </ul>
    </div>
    <input type="text" class="B-a" id="search" placeholder="名称">
    <button id="check-button">查询</button>
    <a href="http://localhost:8080/mainPageRecommend" th:href="@{/mainPageRecommend}"><button class="back">返回首页</button></a>
    <a href="" class="person"><img src="../static/img/image1.png " alt=""  th:src="${user.avatar}">
        <div class="admin-name"  th:text="${user.username}">烧饼</div></a>
    <div id="pinglunCenter" class="content">
        <button id="addButton3" class="add-button">添加</button>
        <table class="adminManagement-table" >
            <thead>
            <tr>
                <th><input type="checkbox" class="selectAll"></th>
                <th>昵称</th>
                <th>关联标题</th>
                <th>评论</th>
                <th>评论时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody id="table-body">
            <tr th:each="comment,stat:${commentList}">
                <td><input type="checkbox" class="rowCheckbox" th:value="${comment.id}"></td>
                <td th:text="${userList[stat.index]}"></td> <!-- 从userList中按索引取昵称 -->
                <td th:text="${postList[stat.index]}"></td> <!-- 从postList中按索引取关联标题 -->
                <td>
                    <div class="contents" th:text="${comment.content}"></div>
                </td>
                <td th:text="${comment.createdAt}"></td>
                <td>
                    <button class="editbtn text-xl" th:data-id="${comment.id}">详情</button>
                    <button class="deletebtn" th:data-id="${comment.id}">驳回</button>
                    <button class="editbtns text-xl" th:data-id="${comment.id}">通过</button>
                </td>
            </tr> <tbody></table>
        <div class="pagination" id="pageNav"></div>
    </div>
    <!-- 评论编辑 -->
    <div id="commentEditModal" class="modal" style="display: none;">
        <div class="bg">
            <div class="title-edit">编辑栏</div>
            <label for="commentNamePostTitle" class="lable1">昵称为：<input type="text" id="commentNamePostTitle" class="PostTitle" placeholder="昵称"></label>
            <label for="commentRelatedTitle" class="lable2" style="margin-left: -40px;">关联标题为：<input type="text" id="commentRelatedTitle" class="EditPostTitle" placeholder="帖子标题" maxlength="10"></label>
            <label class="lable3" style="margin-left: -41px;">评论内容为：</label>
            <div id="commentEditPostContentDiv" class="border border-gray-300 p-2 rounded-md w-full h-32 mb-2" style="overflow-y: auto; white-space: pre-line;" contenteditable="true"></div>
            <div class="cr">插入图片&nbsp;&nbsp;&nbsp;+</div>
            <label for="commentTime" class="lable4" style="margin-left: -40px;">评论时间为：<input type="text" id="commentTime" class="postTitle" placeholder="时间"></label>
            <button class="saveEditPost" id="commentEditModalSaveButton"  style="margin-top: 670px; margin-left: 198px;">保存</button>
            <button class="cancelEditPost">取消</button>
        </div>
    </div>
    <div id="addModal2" class="addModal">
        <div class="bg1">
            <div class="title-edit">添加栏</div>
            <label for="commentNamePostTitle" class="lable1">昵称为：<input type="text" id="commentNamePostTitle" class="PostTitle" placeholder="昵称"></label>
            <label for="commentRelatedTitle" class="lable2" style="margin-left: -40px;">关联标题为：<input type="text" id="commentRelatedTitle" class="EditPostTitle" placeholder="帖子标题" maxlength="10"></label>
            <label class="lable3" style="margin-left: -41px;">评论内容为：</label>
            <div id="commentEditPostContentDivs" class="border border-gray-300 p-2 rounded-md w-full h-32 mb-2" style="overflow-y: auto; white-space: pre-line;" contenteditable="true"></div>
            <div class="cr">插入图片&nbsp;&nbsp;&nbsp;+</div>
            <label for="commentTime" class="lable4" style="margin-left: -40px;">评论时间为：<input type="text" id="commentTime" class="postTitle" placeholder="时间"></label>
            <button class="saveEditPost" id="commentEditModalSaveButton"  style="margin-top: 670px; margin-left: 198px;">保存</button>
            <button class="cancelEditPost cancelEditPost2">取消</button>
        </div>
    </div>
    <script src="../static/js/behind manager-3.js" th:src="@{/js/behind manager-3.js}"></script>
</body>

</html>